﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel.DataAnnotations;
namespace DAL
{
    using DAL.Framework;

    [Table("SysPerson")]
    public partial class SysPerson : IBaseEntity
    {
        /// <summary>
        /// 主键
        /// </summary>
        [Column("Id")]
        [Key]
        [Display(Name = "主键", Order = 1)]
        public string Id { get; set; }

        /// <summary>
        /// 用户名
        /// </summary>
        [Column("Name")]
        [Required(ErrorMessage = "不能为空")]
        [ScaffoldColumn(true)]
        [StringLength(200, ErrorMessage = "长度不可超过200")]
        [Display(Name = "用户名", Order = 2)]
        public string Name { get; set; }

        /// <summary>
        /// 姓名
        /// </summary>
        [Column("MyName")]
        [StringLength(200, ErrorMessage = "长度不可超过200")]
        [Display(Name = "姓名", Order = 3)]
        public string MyName { get; set; }

        /// <summary>
        /// 密码
        /// </summary>
        [Column("Password")]
        [Required(ErrorMessage = "不能为空")]
        [ScaffoldColumn(true)]
        [StringLength(200, ErrorMessage = "长度不可超过200")]
        [DataType(DataType.Password)]
        [Display(Name = "密码", Order = 4)]
        public string Password { get; set; }

        /// <summary>
        /// 确认密码
        /// </summary>
        [Column("SurePassword")]
        [ScaffoldColumn(true)]
        [StringLength(200, ErrorMessage = "长度不可超过200")]
        [DataType(DataType.Password)]
        [System.Web.Mvc.Compare("Password", ErrorMessage = "两次密码不一致")]
        [Display(Name = "确认密码", Order = 5)]
        public string SurePassword { get; set; }

        /// <summary>
        /// 手机号码
        /// </summary>
        [Column("MobilePhoneNumber")]
        [StringLength(200, ErrorMessage = "长度不可超过200")]
        [DataType(DataType.PhoneNumber, ErrorMessage = "号码格式不正确")]
        [Display(Name = "手机号码", Order = 6)]
        public string MobilePhoneNumber { get; set; }

        /// <summary>
        /// 办公电话
        /// </summary>
        [Column("PhoneNumber")]
        [StringLength(200, ErrorMessage = "长度不可超过200")]
        [DataType(DataType.PhoneNumber, ErrorMessage = "号码格式不正确")]
        [Display(Name = "办公电话", Order = 7)]
        public string PhoneNumber { get; set; }

        /// <summary>
        /// 省
        /// </summary>
        [Column("Province")]
        [StringLength(200, ErrorMessage = "长度不可超过200")]
        [Display(Name = "省", Order = 8)]
        public string Province { get; set; }

        /// <summary>
        /// 市
        /// </summary>
        [Column("City")]
        [StringLength(200, ErrorMessage = "长度不可超过200")]
        [Display(Name = "市", Order = 9)]
        public string City { get; set; }

        /// <summary>
        /// 县
        /// </summary>
        [Column("Village")]
        [StringLength(200, ErrorMessage = "长度不可超过200")]
        [Display(Name = "县", Order = 10)]
        public string Village { get; set; }

        /// <summary>
        /// 联系地址
        /// </summary>
        [Column("Address")]
        [StringLength(200, ErrorMessage = "长度不可超过200")]
        [Display(Name = "联系地址", Order = 11)]
        public string Address { get; set; }

        /// <summary>
        /// 邮箱
        /// </summary>
        [Column("EmailAddress")]
        [StringLength(200, ErrorMessage = "长度不可超过200")]
        [DataType(DataType.EmailAddress, ErrorMessage = "邮箱地址格式不正确")]
        [Display(Name = "邮箱", Order = 12)]
        public string EmailAddress { get; set; }

        /// <summary>
        /// 备注
        /// </summary>
        [Column("Remark")]
        [StringLength(4000, ErrorMessage = "长度不可超过4000")]
        [Display(Name = "备注", Order = 13)]
        public string Remark { get; set; }

        /// <summary>
        /// 状态
        /// </summary>
        [Column("State")]
        [StringLength(200, ErrorMessage = "长度不可超过200")]
        [Display(Name = "状态", Order = 14)]
        public string State { get; set; }

        /// <summary>
        /// 部门
        /// </summary>
        [Column("SysDepartmentId")]
        [StringLength(36, ErrorMessage = "长度不可超过36")]
        [Display(Name = "部门", Order = 15)]
        public string SysDepartmentId { get; set; }

        [Column("CreateTime")]
        [ScaffoldColumn(false)]
        [Display(Name = "创建时间", Order = 16)]
        public DateTime? CreateTime { get; set; }

        [Column("CreatePerson")]
        [ScaffoldColumn(true)]
        [StringLength(200, ErrorMessage = "长度不可超过200")]
        [Display(Name = "创建人", Order = 17)]
        public object CreatePerson { get; set; }

        [Column("UpdateTime")]
        [ScaffoldColumn(false)]
        [Display(Name = "编辑时间", Order = 18)]
        public DateTime? UpdateTime { get; set; }

        [Column("UpdatePerson")]
        [ScaffoldColumn(true)]
        [StringLength(200, ErrorMessage = "长度不可超过200")]
        [Display(Name = "编辑人", Order = 19)]
        public object UpdatePerson { get; set; }

        [Timestamp]
        [Column("Version")]
        public Byte[] Version { get; set; }

        public virtual ICollection<SysRole> SysRole { get; set; }

        [ForeignKey("SysDepartmentId")]
        public virtual SysDepartment SysDepartment { get; set; }

        [NotMapped]
        [Display(Name = "角色")]
        public string SysRoleId { get; set; }
        [NotMapped]
        [Display(Name = "角色")]
        public string SysRoleIdOld { get; set; }
        [NotMapped]
        [Display(Name = "部门")]
        public string SysDepartmentIdOld { get; set; }
        
        #region 自定义属性

        #endregion

    }
  

}

